package zhang.automobileservice;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import bean.Second_Car_Item;

public class MoreCarDetialActivity extends FarterActivity implements View.OnClickListener {

    private ImageButton finish;
    private TextView tv_01;
    private TextView tv_phone;
    private TextView tv_company;
    private TextView tv_web;
    private TextView tv_rank;
    private TextView tv_rank01;
    private TextView tv_engine01;
    private TextView tv_engine;
    private TextView tv_speed01;
    private TextView tv_speed;
    private TextView tv_construction01;
    private TextView tv_construction;
    private TextView tv_h_w_w01;
    private TextView tv_h_w_w;
    private TextView tv_wheel01;
    private TextView tv_wheel;
    private TextView tv_trunk01;
    private TextView tv_trunk;
    private TextView tv_quality01;
    private TextView tv_quality;
    private TextView tv_engine_params;
    private TextView tv_engine_displace01;
    private TextView tv_engine_displace;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_more_car_detial);
        initView();
        setView();
    }

    private void setView() {
       /*type": "英菲尼迪",
        "title": "英菲尼迪QX70 2013款 3.\n7L 标准版\n",
                "price": 46.8,
                "km": 5,
                "company": "郑州真容\n二手车",
                "place": "河南省郑州市文化北路与三全路交叉口向北300米路西路路通停车场真容停车区",
                "detail": "电　　话：13461058888\n地　　址：河南省郑州市文化北路与三全路交叉口向北300米路西路路通停车场真容停车区\n",
                "buyDate": "2014-07-01",
                "auto": "自动",
                "outputValue": 3.7,
                "color": "白色",
                "transferTime": 1,
                "district": "郑州",
                "film": "英菲尼迪(进口)",
                "level": "中大型SUV",
                "engine": "3.7L 351马力 V6",
                "gearbox": "7挡手自一体",
                "structre": "5门5座SUV",
                "volume": "4862*1928*1680",
                "wheelbase": 2885,
                "trunksize": 600,
                "quality": 2010,
                "image": "43_1.PNG,43_2.PNG,43_3.PNG,43_4.PNG,43_5.PNG,43_6.PNG",
                "tab": "原厂质保"*/
        Second_Car_Item secondCar = (Second_Car_Item) getIntent().getSerializableExtra("bundle");
        tv_phone.setText(secondCar.getTitle());
        tv_web.setText(secondCar.getType());
        tv_rank01.setText(secondCar.getLevel());
        tv_engine.setText(secondCar.getEngine());
        tv_speed.setText(secondCar.getGearbox());
        tv_construction.setText(secondCar.getStructre());
        tv_h_w_w.setText(secondCar.getVolume());
        tv_wheel.setText(secondCar.getWheelbase());
        tv_trunk.setText(secondCar.getTrunksize());
        tv_quality.setText(secondCar.getQuality());
        tv_engine_displace.setText(secondCar.getOutputValue());
    }

    private void initView() {
        finish = (ImageButton) findViewById(R.id.finish);
        tv_01 = (TextView) findViewById(R.id.tv_01);
        tv_phone = (TextView) findViewById(R.id.tv_phone);
        tv_company = (TextView) findViewById(R.id.tv_company);
        tv_web = (TextView) findViewById(R.id.tv_web);
        tv_rank = (TextView) findViewById(R.id.tv_rank);
        tv_rank01 = (TextView) findViewById(R.id.tv_rank01);
        tv_engine01 = (TextView) findViewById(R.id.tv_engine01);
        tv_engine = (TextView) findViewById(R.id.tv_engine);
        tv_speed01 = (TextView) findViewById(R.id.tv_speed01);
        tv_speed = (TextView) findViewById(R.id.tv_speed);
        tv_construction01 = (TextView) findViewById(R.id.tv_construction01);
        tv_construction = (TextView) findViewById(R.id.tv_construction);
        tv_h_w_w01 = (TextView) findViewById(R.id.tv_h_w_w01);
        tv_h_w_w = (TextView) findViewById(R.id.tv_h_w_w);
        tv_wheel01 = (TextView) findViewById(R.id.tv_wheel01);
        tv_wheel = (TextView) findViewById(R.id.tv_wheel);
        tv_trunk01 = (TextView) findViewById(R.id.tv_trunk01);
        tv_trunk = (TextView) findViewById(R.id.tv_trunk);
        tv_quality01 = (TextView) findViewById(R.id.tv_quality01);
        tv_quality = (TextView) findViewById(R.id.tv_quality);
        tv_engine_params = (TextView) findViewById(R.id.tv_engine_params);
        tv_engine_displace01 = (TextView) findViewById(R.id.tv_engine_displace01);
        tv_engine_displace = (TextView) findViewById(R.id.tv_engine_displace);
        finish.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.finish:
                finish();
                break;
        }
    }
}
